[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Makes a deep clone of this bag. A new bag is created with a clone of
each element of this bag, by calling ICloneable.Clone on each element. If T is
a value type, then each element is copied as if by simple assignment.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
public OrderedBag<T> CloneContents() |
Visual Basic (Declaration) |
---|
Public Function CloneContents As OrderedBag(Of T) |
Visual C++ |
---|
public: OrderedBag<T>^ CloneContents () |
Return Value
The cloned bag.Remarks
If T is a reference type, it must implement ICloneable. Otherwise, an InvalidOperationException is thrown.
Cloning the bag takes time O(N log N), where N is the number of items in the bag.
Exceptions
Exception | Condition |
---|---|
System..::InvalidOperationException | T is a reference type that does not implement ICloneable. |
See Also
OrderedBag<(Of <T>)> Class
Wintellect.PowerCollections Namespace